<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html; charset=UTF-8" %>

<h3>Câu hỏi mới nhất</h3>
<div style="float:left; clear: both" >
    <ul>
        <s:iterator value="questions" var="q" >
            <li class="question">
                <div class="questionTitle">
                    <a  href="<s:url action="viewQuestion" includeParams="" ><s:param name="q" value="#q.id" /></s:url>">
                        <s:property value="#q.subject" />
                    </a>
                </div>
                <div style="margin-top: 5px; clear: both">
                    <div style="float: left;">câu trả lời: <b><s:property value="#q.numAns" /></div> 
                    <div class="questionEx">
                        <div style="float:right; margin-left: 10px;">
                            <img src="/QAWeb/images/avatar.jpg" width="50" height="50" />
                        </div>
                        <div style="float: left">
                            <div class="asker"> <a href="#"> <s:property value="#q.asker.fullname" /></a> </div>
                            <div><s:property value="%{@thesis.haipv.qa.utils.Util@timeFormat(#q.createTime)}" /></div>
                        </div>
                    </div>
                </div>

            </li>
        </s:iterator>
    </ul>
</div>
<div align="center" class="paging">
    <s:if test="paging.isPrev">
        <span class="page" >
            <a  href="<s:url action="index" ><s:param name="page" value="%{paging.currentPage-1}" /></s:url>">
                Trước
            </a>
        </span>
    </s:if>
    <s:iterator value="paging.pages" var="p" >
        <span class="page" >
            <s:if test="%{paging.currentPage != #p}" >
                <a  href="<s:url action="index" ><s:param name="page" value="#p" /></s:url>">
                    <s:property value="#p" />
                </a>
            </s:if>
            <s:else>
                <s:property value="paging.currentPage" />
            </s:else>
        </span>
    </s:iterator>
    <s:if test="paging.isNext">
        <span class="page" >
            <a  href="<s:url action="index" ><s:param name="page" value="%{paging.currentPage+1}" /></s:url>">
                Sau
            </a>
        </span>
    </s:if>
</div>